package com.nbpt;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Paint;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
import android.widget.Toast;

public class ContactActivity extends AppCompatActivity {
    TextView textView15;
    TextView textView14;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contact);

        textView15 = findViewById(R.id.textView15);
        textView14 = findViewById(R.id.textView14);
        textView15.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        textView14.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        getSupportActionBar().setTitle("联系我们");


        if(checkSelfPermission("android.permission.CALL_PHONE")!=PackageManager.PERMISSION_GRANTED){
            ActivityCompat.requestPermissions(this,new String[]{"android.permission.CALL_PHONE"},0);
        }
    }
    public void setTextView15(View view){

        Intent intent = new Intent(Intent.ACTION_CALL);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
        Uri uri = Uri.parse("tel://0574-86891367");
        intent.setData(uri);
        //intent.putExtra("sms_body","This is a message");
        startActivity(intent);
    }
    public void setTextView14(View view){


        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
        Uri uri = Uri.parse("https://www.nbpt.edu.cn");
        intent.setData(uri);
        //intent.putExtra("sms_body","This is a message");
        startActivity(intent);
    }
}
